import axios from "axios";
//管理员登录
let login = (data)=>axios.post('/admin/login',data);
//注册
let register = (data)=>axios.post('/admin/register',data);
//检查是否重复名
let check = (data)=>axios.post('/admin/check/username',data);
//获取管理员列表
let list = (params)=>axios.get('/admin/list',{params});
//获取角色列表
let role = (params)=>axios.get('/role/list',{params});
//删除管理员
let remove = (data)=>axios.post('/admin/remove',data);
//编辑管理员
let edit = (data)=>axios.post('/admin/info',data);
//获取管理员信息
let info =(params)=>axios.get('/admin/info',{params});
//更新角色
let people = (id,data)=>axios.put(`/role/${id}`,data);
//添加角色
let add = (data)=>axios.post('/role',data);
//删除角色
let move = (id,data)=>axios.delete(`/role/${id}`,data);
//获取所有菜单
let all =(params)=>axios.get('/menu/all',{params});
//添加菜单
let addmenu = (data)=>axios.post('/menu',data);
//更新菜单
let update = (id,data)=>axios.put(`/menu/${id}`,data);
//删除菜单
let movemenu = (id,data)=>axios.delete(`/menu/${id}`,data);
export default{
    login,
    register,
    check,
   role,
    list,
    remove,
    info,
    edit,
    people,
    add,
    move,
    all,
    addmenu,
    update,
    movemenu,
}
